<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var userList =["zhangsan","lisi","wangwu","zhaoliu"];
    /**
     * arr.shift()删除数组的第一个元素，数组的长度减一
     * 返回值为被删除的元素
    */
   /*  var result=userList.shift();
    //console.log(result);
    //console.log(userList);
    while(userList.length>0){
        userList.shift();

    }
    /**
     * arr.pop()删除数组的最后一个元素
     * /
    console.log(userList); */
    var result1=userList.pop;
    console.log(result1);
</script>
</html>